#ifndef TIMER_H_DEF
#define TIMER_H_DEF

#include <sys/time.h>


class Timer
{
    public:
        Timer();                                    // default constructor

        void   start();                             // start timer
        void   stop();                              // stop the timer
        double getElapsedTime();                    // get elapsed time in second
        double getElapsedTimeInSec();               // get elapsed time in second (same as getElapsedTime)
        double getElapsedTimeInMilliSec();          // get elapsed time in milli-second
        double getElapsedTimeInMicroSec();          // get elapsed time in micro-second

    private:
        double startTimeInMicroSec;                 // starting time in micro-second
        double endTimeInMicroSec;                   // ending time in micro-second
        int    stopped;                             // stop flag 
        timeval startCount;                         //
        timeval endCount;                           //
};

#endif // TIMER_H_DEF

